/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package test;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;
import java.io.UnsupportedEncodingException;
import java.util.StringTokenizer;

/**
 *
 * @author Administrator
 */
public class ReadFile {
    @SuppressWarnings("empty-statement")
    public static void main(String argv[]) throws FileNotFoundException, UnsupportedEncodingException, IOException{
        BufferedReader br=new BufferedReader(new InputStreamReader(new FileInputStream("tree.db"),"UTF8"));
        StreamTokenizer st=new StreamTokenizer(br);
        for (st.nextToken(); st.ttype != StreamTokenizer.TT_EOF;
	     st.nextToken()){
            System.out.println(st.sval);
        }


//        String line=null;
//        while((line=br.readLine())!=null){
//            StringTokenizer st=new StringTokenizer(line);
//            while(st.hasMoreTokens()){
//                System.out.println(st.nextToken());
//
//            }
//
//        }
    }

}
